app.controller('ziyeliuzhuan',['$scope','mainService','$location','$http',function($scope,mainService,$location,$http) {


    if(mainService.getData()){
        $scope.lzyy=mainService.getData().lzyy;

        $scope.slr=mainService.getData().slr;


    }


    $scope.changeState = function (){

                // alert(_that.lzyy)
                mainService.setData({
                    xq:mainService.getData().xq,
                    incoming:mainService.getData().incoming,
                    slrData:mainService.getData().slrData,
                    lzyy:$scope.lzyy
                })


    }
$scope.submit = function () {
    if(getInputs()==false){
        return;
    }
    $http({
        method: "POST",
        url: mainUrl + '/tr/tr-present-detail!addAndUpdate4App.action',
        params: {
            'Authorization': token,
            'presentOrp': mainService.getData().xq.currentPersonOrp,
            'tcrlsid': mainService.getData().xq.yhSid, //对应yhSid	隐患sid
            'troId': mainService.getData().xq.troId,//'	隐患编码
            'presentNameParent': JSON.parse(localStorage.getItem('userData')).userNameCn,//对应当前登录人中文
            'presentIdParent': JSON.parse(localStorage.getItem('userData')).pin,//对应当前登录人身份证
            'presentName': mainService.getData().slr.staffName,//对应选中受理人中文
            'presentId': mainService.getData().slr.identityId,//对应选中受理人身份证
            'presentDepartment': mainService.getData().slr.department,//对应受理人作业部
            'presentArea':'' ,//对应受理人作业区
            'reason': $scope.lzyy ,//流转原因
            'circleDt': getNowFormatDate ,//流转时间当前时间
            'version ':1 ,//默认 1
            'delFlag':0 //默认0
        }
    }).then(
        function (data, status, headers, config) {
            console.log(data)
            //$scope.data = data.data.items;

            mui.hideLoading();
            mui.toast('提交成功');
            $location.path('/liuzhuandaichuliyinhuan');
            mainService.reset()
            // document.getElementsByClassName('mui-switch-blue').addEventListener
        }, function (data, status, headers, config) {
            console.log(data)
            console.log(status)
        })

};

}])